<template>
  <div class="nav-bar">
    <div class="left iconfont" @click="goback">
      <slot name="left">&#xe61c;</slot>
    </div>
    <div class="center">
      <slot name="center"></slot>
    </div>
    <div class="right">
      <slot name="right"></slot>
    </div>
  </div>
</template>

<script>
import {useRouter} from 'vue-router'

export default {
  setup() {
    const router = useRouter();
    const goback=()=>{
      router.go(-1)
    }
    return{
      goback
    }
  }
}
</script>

<style scoped lang="scss">
.nav-bar {
  background-color: var(--color-tink);
  display: flex;
  color: #fff;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  z-index: 9;
  height: 45px;
  line-height: 45px;
  text-align: center;
  box-shadow: 0 2px 0px rgba(100, 100, 100, 0.1);

  .left, .right {
    width: 60px;
    font-size: 15px;
    transform: rotate(180deg);
  }

  .center {
    flex: 1;
    font-size: 16px;

  }
}
</style>
